window.onload=function (ev) {
    var script = document.createElement("script");
    script.setAttribute("type","text/javascript");
    script.setAttribute("src","static/js/simpleAjax.js");
    document.getElementsByTagName('head')[0].appendChild(script);
}

function sign_in(){
    var username = document.getElementById("username").value;
    var password = document.getElementById("password").value;

    ajaxRequest("login.php","get",{username:username,password:password},function () {

        if(this.responseText == "succ")
            window.location="prepare.php";
        else {
            alert(this.responseText);
            window.location = "login_page.php";
        }

    },function () {
        alert("error occur in login");
        window.location="login_page.php";
    })
}
function jump_regist(){
    window.location="regist_page.php";
}